package com.laiketui.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.laiketui.order.domain.BalanceRecord;
import com.laiketui.order.service.BalanceRecordService;
import com.laiketui.order.mapper.BalanceRecordMapper;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
* @author jiangxiang
* @description 针对表【lk_balance_record】的数据库操作Service实现
* @createDate 2024-08-18 12:49:58
*/
@Service
public class BalanceRecordServiceImpl extends ServiceImpl<BalanceRecordMapper, BalanceRecord>
    implements BalanceRecordService{

    @Override
    public boolean addFreezeRecord(Long deductionAmount, Integer storeId, String userId, String orderParentNo,int recordType,String createBy) {
        BalanceRecord balanceRecord = new BalanceRecord();
        balanceRecord.setRecordAmount(deductionAmount);
        balanceRecord.setStoreId(storeId);
        balanceRecord.setUserId(userId);
        balanceRecord.setOrderParentNo(orderParentNo);
        balanceRecord.setRecordType(recordType);
        balanceRecord.setCareatBy(createBy);
        balanceRecord.setCreatTime(new Date());
        return save(balanceRecord);
    }
}




